home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlStatusBarSetSimple.au3 < prev    next >
Text File  |  2007-09-08  |  2KB  |  53 lines

  1. Opt("MustDeclareVars", 1)
  2.  
  3. #include <GUIConstants.au3>
  4. #Include <GuiStatusBar.au3>
  5.  
  6. Local $gui, $StatusBar1, $msg, $button
  7. Local $a_PartsRightEdge[3] = [100, 350, -1]
  8. Local $a_PartsText[3] = ["New Text", "More Text", "Even More Text"]
  9.  
  10. ;================================================================
  11. ; Example 1 - Using AutoIt Control
  12. ;================================================================
  13. $gui = GUICreate("Status Bar Set Simple", 500, -1, -1, -1, $WS_SIZEBOX)
  14. $button = GUICtrlCreateButton("Toggle", 10, 10, 90, 25)
  15. $StatusBar1 = _GUICtrlStatusBarCreate($gui, $a_PartsRightEdge, $a_PartsText)
  16.  
  17. GUISetState(@SW_SHOW)
  18.  
  19. While 1
  20.     $msg = GUIGetMsg()
  21.     Select
  22.         Case $msg = $GUI_EVENT_RESIZED
  23.             _GUICtrlStatusBarResize($StatusBar1)
  24.         Case $msg = $GUI_EVENT_CLOSE
  25.             ExitLoop
  26.         Case $msg = $button
  27.             If _GUICtrlStatusBarIsSimple($StatusBar1) Then
  28.                 _GUICtrlStatusBarSetSimple($StatusBar1, False)
  29.             Else
  30.                 _GUICtrlStatusBarSetSimple($StatusBar1)
  31.                 _GUICtrlStatusBarSetText($StatusBar1, "simple mode", $SB_SIMPLEID)
  32.                 _GUICtrlStatusBarResize($StatusBar1)
  33.             EndIf
  34.     EndSelect
  35.     
  36. WEnd
  37. GUIDelete()
  38.  
  39. ;================================================================
  40. ; Example 2 - External Control
  41. ;================================================================
  42. Opt("WinTitleMatchMode", 4)
  43. Local $h_win = WinGetHandle("classname=SciTEWindow")
  44. Local $h_status = ControlGetHandle($h_win, "", "msctls_statusbar321")
  45. If _GUICtrlStatusBarIsSimple($h_status) Then
  46.     _GUICtrlStatusBarSetSimple($h_status, False)
  47. Else
  48.     _GUICtrlStatusBarSetSimple($h_status)
  49.     Sleep(5000)
  50.     _GUICtrlStatusBarSetSimple($h_status, False)
  51. ;~     _GUICtrlStatusBarSetText ($StatusBar1, "simple mode", $SB_SIMPLEID)
  52. ;~     _GUICtrlStatusBarResize ($StatusBar1)
  53. EndIf